<?php
error_reporting(E_ALL ^ E_NOTICE);
session_start();
$connect = mysql_connect('localhost','root','');
mysql_select_db("admintool");
?>
<?php
if($_SESSION["loggedin"]==true && $_SESSION["role"]==admin)
{
if(isset($_SESSION[msg]))
{
echo $_SESSION[msg];
unset($_SESSION[msg]);
}
?>
<form action="add.php" method="post">
<input type="text" value="<?php echo $_POST['rolename']; ?>" name="rolename"/> 
<input type="submit" value="save" name="rolemanage"/>
</form>
<?php 
if(isset($_POST['rolemanage']))
{
$rolename = $_POST['rolename'];
$roleinsert = "INSERT into role_management (rolename) values('$rolename')";
$role = mysql_query($roleinsert);
header("Location: role_list.php");
}
?>
<?php 

?>
<?php
}
else
{
header("Location: login.php");
}
?>